import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MyFrame extends JFrame {
    public MyFrame() {
        this.setVisible(true);
        this.setBounds(100, 100, 500, 600);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLayout(null);
        JLabel l1 = new JLabel("?");
        this.add(l1);
        l1.setBounds(50, 100, 100, 80);

        JTextField t1 = new JTextField();
        this.add(t1);
        t1.setBounds(50, 50, 80, 40);

        JTextField t2 = new JTextField();
        this.add(t2);
        t2.setBounds(150, 50, 80, 40);

        JButton btn = new JButton("=");
        this.add(btn);
        btn.setBounds(250, 50, 80, 50);

        btn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                int num1 = Integer.parseInt(t1.getText());
                int num2 = Integer.parseInt(t2.getText());
                int result = num1 + num2;
                l1.setText("" + result);

            }
        });
    }
}
